package com.ziyun.erp.web.modules.order.controller;

import com.ziyun.erp.modules.order.service.*;
import io.renren.common.utils.R;
import io.renren.common.validator.ValidatorUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.*;


/**
 * 紫云网提成核算
 *
 * @author 'lu'
 * @email
 * @date 2018-10-13 17:31:39
 */
@RestController
@RequestMapping("order/orderRoyalty")
public class OrderRoyaltyController {
    @Autowired
    private ErpOrderService erpOrderService;

    /**
     * 列表
     *
     * @param params
     * @return
     */
    @RequestMapping("/list")
    public R list(@RequestBody Map<String, Object> params) {
        return erpOrderService.queryOrderRoyaltyPage(params);
    }

    /**
     * 信息
     *
     * @param orderNo
     * @return
     */
    @RequestMapping("/info/{orderNo}")
    public R info(@PathVariable("orderNo") String orderNo) {

        return erpOrderService.orderRoyaltyInfoById(orderNo);
    }

    /**
     * 批量审核
     */
    @RequestMapping("/toBatchAudit")
    public R toBatchAudit(@RequestParam("orderNos") String orderNos) {
        return erpOrderService.toBatchAudit(orderNos);
    }

    /**
     * 批量录入
     *
     * @param orderNos
     * @return
     */
    @RequestMapping("/batchInput")
    public R batchInput(@RequestParam("orderNos") String orderNos) {
        return erpOrderService.batchInput(orderNos);
    }

    /**
     * 审核
     *
     * @param orderNo
     * @return
     */
    @RequestMapping("audit")
    public R audit(@RequestParam("orderNo") String orderNo) {
        return erpOrderService.audit(orderNo);
    }

    @RequestMapping("Revoke")
    public R Revoke(@RequestParam("orderNo") String orderNo) {
        return erpOrderService.Revoke(orderNo);
    }
}


